;; this is incredibly slow! use sys:slurp-file instead
(define file->string
(lambda (path)
(let ((in (open-input-file path))
(out (make-string 0)))
(if in
(let loop ((char (read-char in)))
(if (not (eof-object? char))
(begin (emit (string char) out)
(loop (read-char in)))
(begin (close-port in)
out)))
(begin (print-with-colors 'red 'default #t
(print "Error opening file: "))
(print path "\n")
#f)))))